﻿using ET.DBCommon.DAL;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ET.DBCommon.Model
{
    /// <summary>
    /// 结果竞赛
    /// </summary>
    public class ExamResultsModel : NotifyPropertyChanged
    {
        /// <summary>
        /// 编号
        /// </summary>
        public int ID { get; set; }
        /// <summary>
        /// 实际比赛时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 用户
        /// </summary>
        public int UserID { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string Describe { get; set; }
        public string UserNumber { get; set; }

        private decimal m_TotalScore;
        public bool IsComplete { get; set; }
        /// <summary>
        /// 总得分
        /// </summary>
        public decimal TotalScore
        {
            get
            {
                return this.m_TotalScore;
            }
            set
            {
                this.m_TotalScore = value;
                this.OnPropertyChanged("TotalScore");
            }
        }
        public ObservableCollection<ExamresultsTestQuestionModel> m_ExamresultsTestQuestions;
        /// <summary>
        /// 结果场景列表
        /// </summary>
        public ObservableCollection<ExamresultsTestQuestionModel> ExamresultsTestQuestions
        {
            get { return this.m_ExamresultsTestQuestions; }
            set
            {
                this.m_ExamresultsTestQuestions = value;
                this.OnPropertyChanged("ExamresultsTestQuestions");
            }
        }
            
            
        /// <summary>
        /// 场景结束时间
        /// </summary>
        public DateTime EndTime { get; set; }
        public int TestPaperID { get; set; }

        public String TotalScoreDescribe { get; set; }
        public String TotalScoreDescribe1 { get; set; }
        public String PreTotalScoreDescribe { get; set; }
        private String testtime="";
        public String PreTime
        {
            get
            {
                return ExamResultsDAL.SeclectAlltime(this.ID);
            }
            set
            {
               
                this.OnPropertyChanged("TotalScore");
            }
        }
        public String TestTime
        {
            get
            {
                if (!ExamresultsTestQuestionModel.TestTime)
                {
                    testtime = ExamResultsDAL.SeclectAlltime1(this.ID);
                }
                return testtime;
            }
            set
            {
                testtime = value;
                this.OnPropertyChanged("TotalScore");
            }
        }

    }
}
